<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <title>游戏迷之家-新闻咨询-添加模块</title>
    <meta name="viewport" content="width=device-width,initial-scale=1.0,initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">

    <link rel="stylesheet" href="http://cdn.bootcss.com/bootstrap/3.3.4/css/bootstrap.min.css">
    <style>
        body{
            background: url("http://public.weirongm.com/images/Heise12.jpg") no-repeat;
            background-size: 100% 100%;
        }
        .container-fluid{
            max-width:1200px;
            margin:0 auto;
        }
        select{
            height:39px;
            width:100px;
            border-radius: 10px;
            color:#333;
        }
        #submit{
            margin-bottom:20px;
        }
        input[type=file]{
            width: 100px;
            height:39px;
            border-radius: 10px;
            color:#333;
        }
        input,button,textarea,select,.edui-editor{
            box-shadow: 0px 0px 20px #CCC !important;
            color:#333 !important;
        }
        .edui-editor > div{
            color:#333;
        }
        label{
            color:#FFF;
        }
    </style>
</head>
<body>
    <div class="container-fluid">
        <div class="row">
            <div class="col-lg-12 col-md-12 col-xs-12">
                <h3 style="color:#FFF;">新闻咨询添加</h3>
            </div>
            <div class="col-lg-12 col-md-12 col-xs-12">
                <div class="bs-example" data-example-id="basic-forms">
                    <form action="{:U('News/publish')}" enctype="multipart/form-data" method="post">
                        <div class="form-group col-lg-12 col-md-12 col-xs-12">
                            <label for="title">标题</label>
                            <input type="text" class="form-control" id="title" name="title" placeholder="输入标题，必须填">
                        </div>
                        <div class="form-group col-lg-12 col-md-12 col-xs-12">
                            <label for="jianjie">简介</label>
                            <input type="text" class="form-control" id="jianjie" name="details" placeholder="输入简介，必须填">
                        </div>
                        <div class="form-group col-lg-4 col-md-12 col-xs-12">
                            <label for="biaoqian">标签</label>
                            <input type="text" class="form-control" name="biaoqian" id="biaoqian" placeholder="标签，可多添。用%隔开">
                        </div>
                        <div class="form-group col-lg-2 col-md-12 col-xs-12">
                            <label for="fenlei">分类</label>
                            <br>
                            <select name="column" id="fenlei">
                                <foreach name="column" item="column">
                                    <option value="{$column['id']}">{$column['title']}</option>
                                </foreach>
                            </select>
                        </div>
                        <div class="form-group col-lg-2 col-md-12 col-xs-12">
                            <label for="thumb">缩略图</label>
                            <input type="file" class="form-control" name="thumb" id="thumb" placeholder="选择图片，只能选择一张">
                        </div>
                        <div class="form-group col-lg-12 col-md-12 col-xs-12">
                            <label for="content">内容</label>
                            <textarea id="content" name="content"></textarea>
                        </div>
                        <div class="form-group col-lg-12 col-md-12 col-xs-12" >
                            <label>投票</label>
                            <p><button type="button" class="btn btn-danger openvote">开启投票</button><br/><br/>
                                <input type="text" class="votename form-control" style="display: none" name="vote_title"  placeholder="输入投票标题">
                            </p>
                            <button type="button" id="tp-button" class="btn btn-danger">添加投票选项</button>
                            <p></p>
                            <p id="tp"></p>
                            <!--<input type="text" class="form-control" name="toupiao[]" id="toupiao" placeholder="投票内容">-->
                        </div>
                        <div class="form-group col-lg-12 col-md-12 col-xs-12" style="">
                        <button type="submit" class="btn btn-default"  id="submit">发表文章</button>
                            </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
    <script type="text/javascript" src="/ueditor/ueditor.config.js"></script>
    <script type="text/javascript" src="/ueditor/ueditor.all.min.js"></script>
    <script src="http://apps.bdimg.com/libs/jquery/2.1.1/jquery.min.js"></script>
    <script>
        window.UEDITOR_HOME_URL = "/ueditor/";
        window.onload = function () {
            window.UEDITOR_CONFIG.initialFrameWidth = '100%';
            window.UEDITOR_CONFIG.initialFrameHeight = 500;
            UE.getEditor('content');
        }
    </script>
<script>
    $(function(){
        $('#tp-button').click(function(){
            var str = '<input type="text" class="form-control" name="toupiao[]" id="toupiao"  style="width: 300px" placeholder="投票内容"><br/>';
            $('#tp').before(str);
        })
        $('.openvote').click(function(){
            $('.votename').show();
        })
    })
</script>
</body>
</html>